package test;

import java.io.InputStream;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import beans.Student;

public class testDeleteStudent {
	public static void main(String[] args) {

		InputStream inputStream = testInsert.class.getClassLoader().getResourceAsStream("mybatis.xml");
		SqlSessionFactoryBuilder sqlSessionFactoryBuilder = new SqlSessionFactoryBuilder();
		SqlSessionFactory sqlSessionFactory = sqlSessionFactoryBuilder.build(inputStream);
		SqlSession sqlSession = sqlSessionFactory.openSession();
		String statement ="deleteStudent";
		Student student = new Student();
		student.setID(1004);
		sqlSession.delete(statement,student.getID());
		sqlSession.commit();
		sqlSession.close();
		
	}

}
